﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using HigLabo.Net.Extensions;
using System.Text.RegularExpressions;
using Newtonsoft.Json.Linq;

namespace HigLabo.Net.Twitter
{
    /// <summary>
    /// 
    /// </summary>
    public class Entities : ResponseObject
    {
        /// <summary>
        /// 
        /// </summary>
        public HashTagCollection HashTags { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public MediaCollection Media { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public UrlCollection Urls { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public UserMentionCollection UserMentions { set; get; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsonText"></param>
        public Entities(String jsonText)
        {
            this.SetProperty(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsonText"></param>
        public override void SetProperty(string jsonText)
        {
            var d = this.SetData(jsonText);

            this.HashTags = new HashTagCollection(d.ToString("hashtags"));
            this.Media = new MediaCollection(d.ToString("media"));
            this.Urls = new UrlCollection(d.ToString("urls"));
            this.UserMentions = new UserMentionCollection(d.ToString("user_mentions"));          
        }
    }
}
